Functions


Accessing Resource Entries in a Resource Map

RsrcMapEntry Accesses the resource entries in a resource map in memory directly.

Checking for Errors

ResError Determines what error occurred, if any, after calling a Resource Manager function.

Closing Resource Forks

CloseResFile Closes a resource fork before your application terminates.

Counting and Listing Resource Types

Count1Resources Returns the total number of resources of a given type in the current resource file.
Count1Types Returns the number of resource types in the current resource file.
CountResources Returns the total number of available resources of a given type.
CountTypes Returns the number of resource types in all resource forks open to your application.
Get1IndResource Returns a handle to a resource of a given type in the current resource file.
Get1IndType Gets a resource types available in the current resource file.
GetIndResource Returns a handle to a resource of a given type in resource forks open to your application.
GetIndType Gets a resource type available in resource forks open to your application.

Creating an Empty Resource Fork

CreateResFile Creates an empty resource fork, when the FSpCreateResFile function is not available.
FSpCreateResFile Creates an empty resource fork using a file system specification (FSSpec) record.
HCreateResFile Creates an empty resource fork, when the FSpCreateResFile function is not available.

Disposing of Resources

DetachResource Sets the value of a resource’s handle in the resource map in memory to NULL while keeping the resource data in memory.
ReleaseResource Releases the memory a resource occupies when you have finished using it.
RemoveResource Removes a resource’s entry from the current resource file’s resource map in memory.

Getting Resource Sizes

GetMaxResourceSize Returns the approximate size of a resource.
GetResourceSizeOnDisk Returns the exact size of a resource.

Getting a Unique Resource ID

Unique1ID Gets a resource ID that’s unique with respect to resources in the current resource file.
UniqueID Gets a unique resource ID for a resource.

Getting and Setting Resource Fork Attributes

GetResFileAttrs Gets the attributes of a resource fork.
SetResFileAttrs Sets a resource fork’s attributes.

Getting and Setting Resource Information

GetResAttrs Gets a resource’s attributes.
GetResInfo Gets a resource’s resource ID, resource type, and resource name.
SetResAttrs Sets a resource’s attributes in the resource map in memory.
SetResInfo Sets the name and resource ID of a resource.

Getting and Setting the Current Resource File

CurResFile Gets the file reference number of the current resource file.
HomeResFile Gets the file reference number associated with a particular resource.
UseResFile Sets the current resource file.

Initializing the Resource Manager

InitResources Initializes the Resource Manager. When the system starts up, it automatically calls this function. This function is for system use only, and your application should not call it at any time.
RsrcZoneInit System software automatically calls the RsrcZoneInit function when system software starts up and when the Process Manager starts up. Your application should not call this function directly.

Modifying Resources

AddResource Adds a resource to the current resource file’s resource map in memory.
ChangedResource Sets a flag in the resource’s resource map entry in memory to show that you’ve made changes to a resource’s data or to an entry in a resource map.

Opening Resource Forks

FSpOpenResFile Opens a file’s resource fork using a file system specification (FSSpec) record.
HOpenResFile Opens a file’s resource fork, when the FSpOpenResFile function is not available.
OpenRFPerm Opens a file’s resource fork, when the FSpOpenResFile and HOpenResFile functions are not available.
OpenResFile Opens a resource fork, when the FSpOpenResFile function is not available.

Reading Resources Into Memory

Get1NamedResource Gets a named resource in the current resource file.
Get1Resource Gets resource data for a resource in the current resource file.
GetNamedResource Gets a named resource.
GetResource Gets resource data for a resource specified by resource type and resource ID.
LoadResource Gets resource data after you’ve called the SetResLoad function with the load parameter set to FALSE or when the resource is purgeable.
RGetResource Gets resource data for a resource and includes ROM-resident system resources in the Resource Manager’s search of resource maps.
SetResLoad Enables and disables automatic loading of resource data into memory for functions that return handles to resources.

Reading and Writing Partial Resources

ReadPartialResource Reads part of a resource into memory and work with a small subsection of a large resource.
SetResourceSize Sets the size of a resource on disk.
WritePartialResource Writes part of a resource to disk when working with a small subsection of a large resource.

Writing to Resource Forks

SetResPurge Tells the Memory Manager to pass the handle of a resource to the Resource Manager before purging the data specified by that handle.
UpdateResFile Updates the resource map and resource data for a resource fork without closing it.
WriteResource Writes resource data in memory immediately to a file’s resource fork.

Miscellaneous

CallResErrProc
CreateResFileFSRef
DetachResourceFile
DisposeResErrUPP
FSpOpenOrphanResFile
FSpResourceFileAlreadyOpen
GetNextFOND
GetNextResourceFile
GetTopResourceFile
InsertResourceFile
InvokeResErrUPP
NewResErrProc
NewResErrUPP
OpenResFileFSRef
RegisterResourceEndianFilter
ResourceFileAlreadyOpenFSRef
TempInsertROMMap
addresource
createresfile
get1namedresource
getnamedresource
getresinfo
openresfile
openrfperm
setresinfo

© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)